package networks.event;

public class EventProxy {

    private static EventDispatcher _dispatcher;

    public EventProxy() {
        _dispatcher = new EventDispatcher();
    }

    public static boolean AddEventListener(String eventType, Event callback) {
        return _dispatcher.AddEventListener(eventType, callback);
    }

    public static boolean RemoveEventListener(String eventType) {
        return _dispatcher.RemoveEventListener(eventType);
    }

    public static boolean RemoveEventListener(String eventType, Event callback) {
        return _dispatcher.RemoveEventListener(eventType, callback);
    }

    public static void RemoveAllEventListeners() {
        _dispatcher.RemoveAll();
    }

    public static boolean BroadcastEvent(String eventType) {
        return _dispatcher.BroadcastEvent(eventType, null);
    }

    public static boolean BroadcastEvent(EventData eventData) {
        return _dispatcher.BroadcastEvent(eventData);
    }

    public static boolean BroadcastEvent(String eventType, Object data) {
        EventData eventData = new EventData(eventType, data);
        return _dispatcher.BroadcastEvent(eventType, eventData);
    }

    public static boolean BroadcastEvent(String eventType, EventData eventData) {
        return _dispatcher.BroadcastEvent(eventType, eventData);
    }

    public static boolean HasEventListener(String type) {
        return _dispatcher.HasEventListener(type);
    }

    public static boolean HasEventListener(String type, Event callback) {
        return _dispatcher.HasEventListener(type, callback);
    }

    public static void Destroy() {
        _dispatcher.Destory();
    }
}
